package com.jieshuibao.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.jieshuibao.mapper.WishcodeMapper;
import com.jieshuibao.model.db.Wishcode;
import com.jieshuibao.model.db.WishcodeExample;

@Service
public class WishcodeService{
	
	@Resource
	private WishcodeMapper wishcodeMapper;
	
	public void addWishcode(Wishcode wishcode) {
		wishcodeMapper.insertSelective(wishcode);
	}
	
	public void delWishcodeById(String id) {
		wishcodeMapper.deleteByPrimaryKey(id);
	}
	
	public void updateWishcode(Wishcode wishcode) {
		wishcodeMapper.updateByPrimaryKeySelective(wishcode);
	}
	
	public Wishcode getWishcodeById(String id) {
		return wishcodeMapper.selectByPrimaryKey(id);
	}
	
	public List<Wishcode> getPageWishcode(WishcodeExample wishcodeExample) {
		return wishcodeMapper.selectPage(wishcodeExample);
	}
	
	public int countWishcode(WishcodeExample wishcodeExample) {
		return wishcodeMapper.countByExample(wishcodeExample);
	}
	public List<Wishcode> getWishcodesByExample(WishcodeExample wishcodeExample){
		return wishcodeMapper.selectByExample(wishcodeExample);
	}
	
	
}
